home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / aiffFileOptions.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.6 KB  |  80 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. global proc int aiffFileOptions ( string $parent, string $action,
  18.                                     string $initialOptions, string $resultCallback )
  19. //
  20. //    Description:
  21. //        This script posts the aiff file accessor options.
  22. //
  23. //    Parameters:
  24. //        $parent    - the elf parent layout for this options layout. It is
  25. //                    always a scrollLayout.
  26. //        $action    - the action that is to be performed with this invokation
  27. //                    of this proc. Valid options are:
  28. //                        "query" - construct the options string and pass it
  29. //                                    to the resultCallback.
  30. //                        "post"    - post all the elf controls.
  31. //        $resultCallback    -
  32. //                This is the proc to be called with the result string. 
  33. //                resultCallback ( string $optionsString )
  34. //
  35. //    Returns:
  36. //        1 if successfull.
  37. //        0 otherwise.
  38. //
  39. {
  40.     int      $result;
  41.     string    $currentOptions;
  42.     string     $optionList[];
  43.     string     $optionBreakDown[];
  44.     int        $index;
  45.     
  46.     if ($action == "post") {
  47.         setUITemplate -pushTemplate DefaultTemplate;
  48.         setParent $parent;
  49.  
  50.         floatFieldGrp -l "Sound File Offset" 
  51.             -v1 0 -pre 2 aiffOffsetVal;
  52.                     
  53.         // Now set to current settings.
  54.         //
  55.         $currentOptions = $initialOptions;
  56.         if (size($currentOptions) > 0) {
  57.             tokenize($currentOptions, ";", $optionList);
  58.             for ($index = 0; $index < size($optionList); $index++) {
  59.                 tokenize($optionList[$index], "=", $optionBreakDown);
  60.                 if ($optionBreakDown[0] == "o") {
  61.                     float $value = float( $optionBreakDown[1] );
  62.                     floatFieldGrp -e -v1 $value aiffOffsetVal;
  63.                 }
  64.             }
  65.         }
  66.         setUITemplate -popTemplate;
  67.  
  68.         $result = 1;
  69.     } else if ($action == "query") {
  70.         float $value = `floatFieldGrp -q -v1 aiffOffsetVal`;
  71.         $currentOptions = $currentOptions + "o=" + $value;
  72.         eval($resultCallback+" \""+$currentOptions+"\"");
  73.         $result = 1;
  74.     } else {
  75.         $result = 0;
  76.     }
  77.     
  78.     return $result;
  79. }
  80.